package VUTHANHPHUC_ARRAY;

public class Model_E2 {
	public int valueMax(int[] A) {
		int max = A[0];
		for (int i = 0; i < A.length; i++) {
			if (A[i] > max)
				max = A[i];
		}
		return max;
	}

	public String vitri(int[] A) {
		int max = A[0], min = A[0], iMax = 0, iMin = 0;
		for (int i = 0; i < A.length; i++) {
			if (A[i] > max) {
				max = A[i];
				iMax = i;
			}
			if (A[i] < min) {
				min = A[i];
				iMin = i;
			}
		}
		return +iMax + " and " + iMin;
	}

}